/* DefaultInterceptor.java
 *
 * Copyright 2006, Tim Dwelle.
 *
 * Licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in
 * compliance with the License.  You may obtain a copy of
 * the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in
 * writing, software distributed under the License is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied.  See
 * the License for the specific language governing
 * permissions and limitations under the License.
 *
 */

package dowry.impl;

import javax.servlet.*;
import javax.servlet.http.*;
import dowry.*;

/**
 * DefaultInterceptor is a "no op" implementation of the
 * Interceptor.
 *
 */
public class DefaultInterceptor implements Interceptor
{
    /**
     * Called to indicate the startup of DWR.  This method
     * will be called after DWR finishes its own
     * initialization, but before any remote invocations
     * begin.
     *
     * <p>
     * In this default implementation, this method does
     * nothing.
     * </p>
     *
     * @param cfg  the servlet configuration
     *
     */
    public void onInit(ServletConfig cfg)
    {
    }

    /**
     * Called to indicate the start of invocation of DWR.
     * This will be called before DWR starts processing the
     * incoming invocation.
     *
     * <p>
     * In this default implementation, this method does
     * nothing.
     * </p>
     *
     * @param req  the servlet request
     *
     * @param res  the servlet response
     *
     */
    public void onInvoke(HttpServletRequest req, HttpServletResponse res)
    {
    }

    /**
     * Called to indicate the successful handling of a
     * DWR invocation.  This indicates that no exceptions
     * were thrown during DWR's processing, and no error
     * messages are being marshalled to the DWR client.
     *
     * <p>
     * In this default implementation, this method does
     * nothing.
     * </p>
     *
     * @param req  the servlet request
     *
     * @param res  the servlet response
     *
     */
    public void onSuccess(HttpServletRequest req, HttpServletResponse res)
    {
    }

    /**
     * Called to indicate the handling of a DWR invocation
     * has resulted in an error.  This may happen if an
     * exception was thrown during DWR's processing, or if
     * an error message was marshalled to the client.
     *
     * <p>
     * In this default implementation, this method does
     * nothing.
     * </p>
     *
     * @param req  the servlet request
     *
     * @param res  the servlet response
     *
     */
    public void onError(HttpServletRequest req, HttpServletResponse res)
    {
    }

    /**
     * Called to indicate the shutdown of DWR.  This method
     * will be called just prior to DWR performs its own
     * cleanup.
     *
     * <p>
     * In this default implementation, this method does
     * nothing.
     * </p>
     *
     */
    public void onDestroy()
    {
    }
}